var app = angular.module("loginApp", [])
app.controller("loginController", function($scope, $http) {
	$scope.onClicklogin = function() {
//		alert("用户名是：" + $scope.name)
//		alert("密码是：" + $scope.pwd)

		$http({
			method : 'POST',
			url : '/life/login1',
			params : {
				name : $scope.name,
				password : $scope.pwd
			}
		}).then(function successCallback(response) {
			
			
			
			if ("Y" == response.data.rs) {
				window.location.href = "http://www.zizai.pro/life/Jump";
			} else if (response.data.rs == "S") {
				$scope.errorMsg = "密码错误，请重新输入";
				$('#myModal').modal('show')
			}else if(response.data.rs == "N"){
				$scope.errorMsg = "用户名不存在，请重新输入";
				$('#myModal').modal('show')
			}
		}, function errorCallback(response) {
			alert("1321312")
		});

	}
})